#ifndef _ZERO_ORB_SCHEDULER_H
#define _ZERO_ORB_SCHEDULER_H
#include "ExecuteBody.h"

namespace zero
{
class Scheduler
{
	public:
		static void switchTo(ExecuteBody* to) {
			ExecuteBody* from = ExecuteBody::current();
			asm volatile ( \
				"movl %%ebp, %0\n\t" \
				"movl %%esp, %1\n\t" \
				"movl 1f, %2\n\t" \
				"1:\n\t" \
				"cli\n\t" \
				"movl %3, %%ebp\n\t" \
				"movl %4, %%esp\n\t" \
				"pushl %5\n\t" \
				"iret\n\t" \
				: "=q" (from->ebp), "=q" (from->esp), "=q" (from->eip) \
				: "q" (to->ebp), "q" (to->esp), "q" (to->eip) \
				);
		}

		static List head;

	private:
};
}
#endif
